#include "matrixfunctions.h"

void init(char mat[][100], int row, int col)
{
	int i, j;
	for(i=0; i<row; ++i)
			for(j=0; j<col; ++j)
				mat[i][j]=' ';
}

int main()
{
	char mat[100][100];
	char tmp[100][100];
	int row, col, t, i, j;
	cout<<"Number of rows : ";
	cin>>row;
	cout<<"Number of columns : ";
	cin>>col;
	readmatrix(mat, row, col);
	printmatrix(mat, row, col);
	init(tmp, row, col);
	for(t=0; t<(row/2)+1; ++t){
		cout<<endl;
		for(j=t; j<col-t; j++){
			tmp[t][j]=mat[t][j];
			tmp[row-t-1][j]=mat[row-t-1][j];
		}
		for(i=t; i<row-t; i++){
			tmp[i][col-t-1]=mat[i][col-t-1];
			tmp[i][t]=mat[i][t];
		}
		printmatrix(tmp, row, col);
		init(tmp, row, col);
	}	
return 0;
}
